package com.sherlockHolmes.init.entity.dao;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 圈子表
 * @TableName community
 */
@TableName(value ="community")
@Data
public class Community implements Serializable {
    /**
     * 
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 圈子名称
     */
    private String title;

    /**
     * 标签
     */
    private String tags;

    /**
     * 加入条件
     */
    private String condition;

    /**
     * 条件id
     */
    private Integer conditionId;

    /**
     * 活跃度
     */
    private Double liveness;

    /**
     * 创建人id
     */
    private Integer createUserId;

    /**
     * 圈子类型 0官方圈子 1用户圈子
     */
    private String type;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 0 存在 1解散
     */
    @TableLogic
    private Integer valid;

    /**
     * 解散时间
     */
    private Date deleteTime;

    /**
     * 0 未封 1封
     */
    private Integer ban;

    /**
     * 封禁时间
     */
    private Date banTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Community other = (Community) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getTitle() == null ? other.getTitle() == null : this.getTitle().equals(other.getTitle()))
            && (this.getTags() == null ? other.getTags() == null : this.getTags().equals(other.getTags()))
            && (this.getCondition() == null ? other.getCondition() == null : this.getCondition().equals(other.getCondition()))
            && (this.getConditionId() == null ? other.getConditionId() == null : this.getConditionId().equals(other.getConditionId()))
            && (this.getLiveness() == null ? other.getLiveness() == null : this.getLiveness().equals(other.getLiveness()))
            && (this.getCreateUserId() == null ? other.getCreateUserId() == null : this.getCreateUserId().equals(other.getCreateUserId()))
            && (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getValid() == null ? other.getValid() == null : this.getValid().equals(other.getValid()))
            && (this.getDeleteTime() == null ? other.getDeleteTime() == null : this.getDeleteTime().equals(other.getDeleteTime()))
            && (this.getBan() == null ? other.getBan() == null : this.getBan().equals(other.getBan()))
            && (this.getBanTime() == null ? other.getBanTime() == null : this.getBanTime().equals(other.getBanTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getTitle() == null) ? 0 : getTitle().hashCode());
        result = prime * result + ((getTags() == null) ? 0 : getTags().hashCode());
        result = prime * result + ((getCondition() == null) ? 0 : getCondition().hashCode());
        result = prime * result + ((getConditionId() == null) ? 0 : getConditionId().hashCode());
        result = prime * result + ((getLiveness() == null) ? 0 : getLiveness().hashCode());
        result = prime * result + ((getCreateUserId() == null) ? 0 : getCreateUserId().hashCode());
        result = prime * result + ((getType() == null) ? 0 : getType().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getValid() == null) ? 0 : getValid().hashCode());
        result = prime * result + ((getDeleteTime() == null) ? 0 : getDeleteTime().hashCode());
        result = prime * result + ((getBan() == null) ? 0 : getBan().hashCode());
        result = prime * result + ((getBanTime() == null) ? 0 : getBanTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", title=").append(title);
        sb.append(", tags=").append(tags);
        sb.append(", condition=").append(condition);
        sb.append(", conditionId=").append(conditionId);
        sb.append(", liveness=").append(liveness);
        sb.append(", createUserId=").append(createUserId);
        sb.append(", type=").append(type);
        sb.append(", createTime=").append(createTime);
        sb.append(", valid=").append(valid);
        sb.append(", deleteTime=").append(deleteTime);
        sb.append(", ban=").append(ban);
        sb.append(", banTime=").append(banTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}